import React from 'react';
import { Table } from 'antd';

class List extends React.Component {

  columns = [
    {
      title: '名称',
      dataIndex: 'name',
    },
    {
      title: '描述',
      dataIndex: 'desc',
    },
    {
      title: '链接',
      dataIndex: 'url',
    },
  ];

  componentDidMount() {
    this.props.dispatch({
      type: 'list/queryList',
    });
  }

  render() {

    const { listData } = this.props;

    return (
      <div>
        <Table columns={this.columns} dataSource={listData} rowKey="id" />
      </div>
    );
  }

};

export default List;
